package com.mimiwang.animal.controller;

import com.github.pagehelper.PageInfo;
import com.mimiwang.animal.service.IAnimalPictureService;
import com.mimiwang.animal.vo.AnimalPictureVo;
import com.mimiwang.common.utils.ResponseUtil;
import com.mimiwang.common.vo.school.PageConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @AUTHOR:游李滨
 * @DATE:2023/4/21 13:12
 */

@RestController
@RequestMapping("/animal/picture")
public class AnimalPictureController {

    @Autowired
    IAnimalPictureService animalPictureService;

    @GetMapping("/id/{id}")
    String getAnimalPictureByAnimalId(@PathVariable long id){

        PageInfo<AnimalPictureVo> animalPictureVoPageInfo = animalPictureService.selectPictureListByAnimalId(id,new PageConfig(1,1));

        return ResponseUtil.successJSONData("成功",animalPictureVoPageInfo);
    }
}
